import 'package:flutter/material.dart';

class UnknownRoute extends StatelessWidget {
  final String? routName;

  const UnknownRoute(this.routName, {super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          /*  默认会有一个返回按钮是从哪里来的呢       leading: IconButton(
              icon: const Icon(
                Icons.arrow_back,
              ),
              onPressed: () {
                Navigator.pop(context);
              }),*/
          actions: const <Widget>[
            //放一个空的透明的icon用来是中间的文字居中
            Icon(
              Icons.arrow_back,
              color: Colors.transparent,
            )
          ],
          title: const Center(
              child: Text(
            "Error",
          ))),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text("没有这个路由的地址:$routName"),
            const SizedBox(height: 10),
            TextButton(
              child: const Text(''),
              onPressed: () {
                //Navigator.pop(context);
              },
            ),
          ],
        ),
      ),
    );
  }
}
